<template>
	<view>
		<view class="content">
			<view class="banner">
				<image class="bannerImg" :src="imgUrl" mode=""></image>
			</view>
			<view class="title">
				{{title}}
			</view>
			<view class="subtitle" v-if="subtitle!=null">
				{{subtitle}}
			</view>
			<view class="source">
				来源:{{source}} | {{createDate}}
			</view>
			<rich-text class="richtext" :nodes="string">
				{{string}}
			</rich-text>
			<view class="bottom">
				<writemarkTemp></writemarkTemp>
			</view>
		</view>
	</view>
</template>
<script>
	import writemarkTemp from '../../../../components/writemark-temp.vue';
	import global from '../../../../components/tool/homePageQuery.vue';
	export default {
		components:{
			writemarkTemp
		},
		data() {
			return {
				title: "",
				subtitle:"",
				source:"",
				createDate:"",
				string: '',
				imgUrl:''
			}
		},
		onLoad(e) {
			uni.showLoading();
			console.log(e)
			/* uni.request({
				url: 'https://unidemo.dcloud.net.cn/api/news/36kr/' + e.newsid,
				method: 'GET',
				data: {},
				success: res => {
					console.log(res)
					this.title = res.data.title;
					this.string = res.data.content;
					this.imgUrl=res.data.cover
					uni.hideLoading()
				},
				fail: () => {},
				complete: () => {}
			}); */
			var usrtaken = uni.getStorageSync('token_key');
			var queryId = e.newsid;
			console.log("查询的ID----------------"+queryId)
			uni.request({
				url: global.api.queryFinanceNews,
				method: 'POST', 
				header : {'content-type':'application/x-www-form-urlencoded'},
				data: {  
					queryID: queryId,
					token: usrtaken,
					queryType: 'ZX'
				}, 
				dataType:'json',
				success: res => {
					//console.log(res)
					var zxTemp = new Object();
					zxTemp = res.data.data;
					var zxNews = new Object();
					zxNews = zxTemp.information;//资讯
					console.log("资讯详情展示111111111---------"+JSON.stringify(zxNews));
					this.title = zxNews.news_Tit;
					console.log("资讯详情副标题~~~~~~~~~"+JSON.stringify(zxNews.news_TitChtld))
					this.subtitle = zxNews.news_TitChtld;
					this.string = zxNews.news_Content;
					this.imgUrl = zxNews.thumb_Pic;
					this.source = zxNews.news_Source;
					this.createDate= zxNews.create_Date;
					uni.hideLoading()
				},
				fail: () => {},
				complete: () => {}
			});
		},
		methods:{
			
		},
		onNavigationBarButtonTap(){
			/*uni.navigateTo({
				url: './xinzengdizhi/xinzengdizhi',
				success: res => {},
				fail: () => {},
				complete: () => {}
			});*/
			uni.showLoading({
				title: '敬请期待分享！'
			});
			setTimeout(function () {
					uni.hideLoading();
			}, 1000);
		}
	}
</script>

<style>
	page {
		background: #fff;
	}

	.content {
		padding: 30upx;
		flex-wrap: wrap;
	}

	.title {
		margin: 20upx 0;
		font-size: 17px;
		font-family: PingFang-SC-Bold;
		font-weight: bold;
		color: #ff0000;
		line-height:48upx;
	}
	.subtitle{
		margin: 20upx 0;
		font-size: 15px;
		font-family: PingFang-SC-Bold;
		font-weight: bold;
		color: rgba(68, 68, 68, 1);
		line-height:48upx;
	}
	.source{
		margin: 20upx 0;
		font-size: 12px;
		font-family: PingFang-SC-Bold;
		font-weight: bold;
		color: rgba(68, 68, 68, 1);
		line-height:48upx;
	}

	rich-text {
		font-size: 26upx;
		line-height: 36upx;
		padding-bottom: 110upx;
	}
	.banner,.bannerImg{
		width: 100%;
		height: 370upx;
	}
	.bottom{
		width: 100%;
		position: fixed;
		bottom: 0;
	}
</style>
